package at.fpmedv.eclipse.helma.core;

import java.util.Comparator;

import at.fpmedv.eclipse.helma.util.ResourceContainer;

public class CoreFunctionTreeObject extends FunctionTreeObject {

	public CoreFunctionTreeObject(String propertyName,
			HelmaPrototypeTreeObject parent) {
		super(propertyName, parent);
	}
	
	public int compare(ITreeObject element, Comparator comparator) {
		// sort by name
		if (element instanceof CoreFunctionTreeObject)
			return comparator.compare(this.getName(), element.getName());
		// smaller than javascript functions
		if (element instanceof FunctionTreeObject)
			return 1;
		// greater than skins
		if (element instanceof SkinTreeObject)
			return -1;
		// smaller than everything else
		return 1;

	}
	
	public ResourceContainer getResource() {
		return null;
	}
}
